package com.alibaba.citrus.ots.price.ability.functions.entity.price;

import lombok.Data;

import java.util.Map;

/**
 * @author: qiaojiange
 * @create: 2021/09/15
 * @Description 价格实体，聚合根 聚合了价格类型，价格维度，价格存储值
 */

@Data
public class PriceEntity {
    /**
     * 货品编号
     */
    private String itemId;


    /**
     * 标签
     */
    private String queryFlag;
    /**
     * 扩展字段
     */
    private Map features;
    /**
     * 价格类型实体
     */
    private PriceTypeEntity priceTypeEntity;
    /**
     * 维度配置实体
     */
    private PriceDimensionConfigEntity dimensionConfigEntity;
    /**
     * 价格记录实体
     */
    private PriceRecordEntity recordEntity;

    public PriceEntity() {

    }

    public Boolean obtainIsNegativeFlag() {
        return priceTypeEntity == null ? null : priceTypeEntity.obtainIsNegativeFlag();
    }

    public Boolean obtainIsManualFlag() {
        return priceTypeEntity == null ? null : priceTypeEntity.obtainIsManualFlag();
    }

    public Boolean obtainTitleFlag() {
        return priceTypeEntity == null ? null : priceTypeEntity.obtainIsTitleFlag();
    }

    public Long obtainMoneyAmout() {
        return recordEntity == null ? null : recordEntity.obtainMoneyAmout();
    }

    public String obtianMoneyPercentage() {
        return recordEntity == null ? "" : recordEntity.obtainMoneyPercentage();

    }

    public String obtainCurrency() {
        return recordEntity == null ? "" : recordEntity.obtainCurrency();

    }

    public String obtainCaculatePattern() {
        return priceTypeEntity == null ? "" : priceTypeEntity.obtainCaculatePattern();
    }

    public String obtainPriceUnit() {
        return recordEntity == null ? "" : recordEntity.obtainPriceUnit();
    }

    public Long obtainItemCount() {
        return recordEntity == null ? null : recordEntity.obtainItemCount();
    }

    public String obtainPriceType() {
        return dimensionConfigEntity == null ? null : dimensionConfigEntity.obtainPriceType();
    }

    public String obtainQueryFlag() {
        return queryFlag;
    }
}
